<template>
    <div class="experienceClass">
        <div class="experience_inputs">
            <div class="creatBtn"  id="tour_position3">
                <creatExperience @refresh='doRefresh'></creatExperience>
            </div>
            <div class="operate_inputs">
                <el-form :inline="true" :model="formInline" class="demo-form-inline">
                    <el-form-item label="班级名称:">
                        <el-input class='divided_3' v-model="formInline.key_word"></el-input>
                    </el-form-item>
                    <el-form-item label="班级人数范围:">
                        <el-input class='divided_3' v-model="formInline.min_num"></el-input>
                    </el-form-item>
                    <el-form-item label='—'>
                        <el-input class='divided_3' v-model="formInline.max_num"></el-input>
                    </el-form-item>
                    <el-form-item>
                        <el-button class="search_btn" type="primary" @click="searchExclass"><i class="el-icon-search"></i>查询</el-button>
                        <el-button class="reset_btn" type="primary" @click="clearSearch"><i class="el-icon-refresh"></i>清空查询</el-button>
                    </el-form-item>
                </el-form>
            </div>
        </div>
        <el-table
            v-loading="loading2"
            element-loading-text="加载中..."
            :data="experienceData"
            stripe 
            size="mini"
            border resizable
            style="width: 100%"
            :height="tableHeight">
            <el-table-column
                label="班级ID"
                prop="id"
                :align="align">
            </el-table-column>
            <el-table-column
                label="班级名称"
                prop="name"
                :align="align">
            </el-table-column>
            <el-table-column
                label="销售"
                prop="_sale_name"
                :align="align">
            </el-table-column> 
            <el-table-column
                label="助教"
                prop="_assistant_name"
                :align="align">
            </el-table-column>
            <el-table-column
                label="学员数"
                prop="total_student"
                :align="align">
            </el-table-column>
            <el-table-column
                label="备注"
                prop="remark"
                :align="align">
            </el-table-column>                    
            <el-table-column 
                fixed="right" 
                align="center"
                min-width="360"
                label="操作">
                <template slot-scope="scope">
                    <el-button
                        size="mini"
                        @click="editClass(scope.row.id)">编辑班级</el-button>
                    <el-button
                        size="mini"
                        @click="classTable(scope.row.id)">班级课表</el-button>
                    <el-button
                        size="mini"
                        @click="removeClass(scope.row.id)">解散班级</el-button>
                    <el-button
                        size="mini"
                        @click="reserverClass(scope.row.id)">约课</el-button>
                </template>
            </el-table-column>
        </el-table>
        
        <div class="page_block">
            <el-pagination
                background
                @current-change="handleCurrentChange"
                :current-page.sync="currentPage"
                :page-size="page_size"
                small
                layout="prev, pager, next, jumper"
                :total="totalCount">
            </el-pagination>
        </div>


        <!-- 编辑班级 -->
        <el-dialog title="编辑体验班" 
            width='beforeAddwidth'
            :modal=false
            :close-on-click-modal=false
            :visible.sync="dialogFormVisible1">
            <el-form :model="classDetail">
                <el-form-item label="班级名称：" :label-width="formLabelWidth">
                    <el-input v-model="classDetail.name" auto-complete="off"></el-input>
                </el-form-item>
                <el-form-item label="销售：" :label-width="formLabelWidth">
                    <el-select v-model="classDetail.assistant">
                        <el-option v-for="(sale,j) in saleList" :key="j" :label="sale.realname" :value="sale.userid"></el-option>
                        <el-option label=" " value="0"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="线下中教：" :label-width="formLabelWidth">
                    <el-select v-model="classDetail.saleid">
                        <el-option v-for="(teacher,i) in teacherList" :key="i" :label="teacher.realname" :value="teacher.userid"></el-option>
                        <el-option label=" " value="0"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="班级备注：" :label-width="formLabelWidth">
                    <el-input v-model="classDetail.remark" auto-complete="off"></el-input>
                </el-form-item>
                <addtoClass 
                    :allStudents='allStudents' 
                    :classid="classid" 
                    :classtype='classtype' 
                    @refreshList="getStudentList"></addtoClass>
            </el-form>
            <el-table   
                :data="studentList"
                v-if='studentList'
                stripe 
                size="mini"
                border resizable
                style="width: 100%;margin-left:60px;"
                max-height="656">
                <el-table-column
                    label="学员账号"
                    prop="member.username"
                    :align="align"
                    :width="columWidth2">
                </el-table-column>
                <el-table-column
                    label="学员姓名"
                    prop="member.nickname"
                    :align="align"
                    :width="columWidth2">
                </el-table-column>
                <el-table-column label="学员性别" :align="align" :width="columWidth2">
                    <template slot-scope="scope">{{scope.row.member.gender==1?'男':'女'}} </template>
                </el-table-column> 
                <el-table-column
                    label="学员状态"
                    prop="member._status_name"
                    :align="align"
                    :width="columWidth2">
                </el-table-column>
                <el-table-column
                    label="录入人"
                    prop="member.agentAddPersonName"
                    :align="align"
                    :width="columWidth2">
                </el-table-column>   
                <el-table-column label="注册时间" :align="align" :width="columWidth2">
                    <template slot-scope="scope">{{scope.row.created_time | transData}} </template>
                </el-table-column>             
                <el-table-column 
                    fixed="right" 
                    :align="align"
                    min-width="200"
                    label="操作">
                    <template slot-scope="scope">
                        <el-button
                            size="mini"
                            @click="outClass(scope.row.classid,scope.row.member.userid)">移出班级</el-button>
                        <el-button
                            size="mini"
                            type="info" plain
                            @click="getFile(scope.row.member.userid,scope.row.member.ischild)">档案</el-button>
                    </template>
                </el-table-column>
            </el-table>

            <div>
                <el-dialog title="查看少儿学员资料" 
                    :close-on-click-modal=false 
                    v-if="ifchild" 
                    :modal=false
                    :visible.sync="dialogFormVisibleda">
                    <el-form :model="form">
                        <el-form-item label-width="80px">
                            <div class="member_info">学员信息</div>
                        </el-form-item>
                        <el-form-item label="昵称：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.nickname"></el-input>
                        </el-form-item>
                        <el-form-item label="手机号：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.mobile"></el-input>
                        </el-form-item>
                        <el-form-item label="真实姓名：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.fullname"></el-input>
                        </el-form-item>
                        <el-form-item label="发送信息给学员：" :label-width="formLabelWidth">
                            <el-radio-group disabled v-model="form.sendmail">
                                <el-radio label=1>是</el-radio>
                                <el-radio label=0>否</el-radio>
                            </el-radio-group>
                        </el-form-item>
                        <el-form-item label="QQ：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.qq"></el-input>
                        </el-form-item>
                        <el-form-item label="SKype：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.skypenum" ></el-input>
                        </el-form-item>
                        <el-form-item label="Email：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.email"></el-input>
                        </el-form-item>
                        <el-form-item label="性别：" :label-width="formLabelWidth">
                            <el-radio-group  disabled v-model="form.gender">
                                <el-radio label=1>男</el-radio>
                                <el-radio label=0>女</el-radio>
                            </el-radio-group>
                        </el-form-item>
                        <el-form-item label="出生日期：" :label-width="formLabelWidth">
                            <div class="block">
                                <el-date-picker
                                v-model="form.birthday"
                                type="date"
                                disabled
                                value-format="yyyy-MM-dd"
                                placeholder="选择日期">
                                </el-date-picker>
                            </div>
                        </el-form-item>
                        <el-form-item label="喜欢的动画片或玩具：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.toycartoon"></el-input>
                        </el-form-item>
                        <el-form-item label="所在年级：" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.shoolPeriod" @change='getPeriod' placeholder="选择学年" class="divided_3">
                                <el-option 
                                v-for="(sp,a) in childData.shoolperiod"
                                :key="a" :label="sp.attriname" 
                                :value="sp.attriid"></el-option>
                            </el-select>
                            <el-select disabled v-model="form.grade" placeholder="选择年级" class="divided_3">
                                <el-option v-for="(gradeitem,gd) in grade_lists" :key='gd' :label="gradeitem" :value="gd"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="性格特点：" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.character" placeholder="选择性格">
                                <el-option 
                                v-for="(childcc,b) in childData.childcharacters"
                                :key="b" :label="childcc.attriname" :value="childcc.attriid"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="礼品邮寄地址：" :label-width="formLabelWidth">
                            <el-cascader
                                size="large"
                                disabled
                                :options="options"
                                v-model="form.address"
                                @change="handleChange">
                            </el-cascader>
                            <el-input v-model="form.giftAddr" class="divided_200"></el-input>
                        </el-form-item>
                        <el-form-item :label-width="formLabelWidth" label="学习渠道：">
                            <el-checkbox-group disabled v-model="form.studyfrom">
                                <el-checkbox 
                                v-for="(studyf,d) in childData.studyfrom"
                                :key="d" :label="studyf.attriid">{{studyf.attriname}}</el-checkbox>
                            </el-checkbox-group>
                        </el-form-item>
                        <el-form-item label-width="80px">
                            <div class="member_info">家庭信息</div>
                        </el-form-item>
                        <el-form-item label-width="80px">
                            <el-tag type="info">父亲信息</el-tag>
                        </el-form-item>
                        <el-form-item label="姓名：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.dadname"></el-input>
                        </el-form-item>
                        <el-form-item label="手机号：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.dadmobile"></el-input>
                        </el-form-item>
                        <el-form-item label="年龄：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.dadage"></el-input>
                        </el-form-item>
                        <el-form-item label="职业性质：" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.dadjobs" placeholder="选择父亲职业">
                                <el-option 
                                v-for="(dadjob,e) in childData.jobs"
                                :key="e" :label="dadjob.attriname" :value="dadjob.attriid"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label-width="80px">
                            <el-tag type="info">母亲信息</el-tag>
                        </el-form-item>
                        <el-form-item label="姓名：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.mumname"></el-input>
                        </el-form-item>
                        <el-form-item label="手机号：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.mummobile"></el-input>
                        </el-form-item>
                        <el-form-item label="年龄：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.mumage"></el-input>
                        </el-form-item>
                        <el-form-item label="职业性质：" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.mumjob" placeholder="选择母亲职业">
                                <el-option 
                                v-for="(mumjob,f) in childData.jobs"
                                :key="f" :label="mumjob.attriname" :value="mumjob.attriid"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="家庭收入：" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.familyincome" placeholder="请选择">
                                <el-option 
                                v-for="(fain,g) in childData.familyincomes"
                                :key="g" :label="fain.attriname" :value="fain.attriid"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="是否已经开始学习英语：" :label-width="formLabelWidth">
                            <el-radio-group disabled  v-model="form.alreadystudy">
                                <el-radio label=1>是</el-radio>
                                <el-radio label=0>否</el-radio>
                            </el-radio-group>
                        </el-form-item>
                        <el-form-item v-if='form.alreadystudy==1?true:false' label="学习了多久（单位：月）：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.studytime"></el-input>
                        </el-form-item>
                        <el-form-item v-if='form.alreadystudy==1?true:false' label="学习英语以哪种方式开始：" :label-width="formLabelWidth">
                            <el-radio-group disabled  v-model="form.stratway">
                                <el-radio 
                                v-for="(starw,h) in childData.startways"
                                :key="h" :label="starw.attriid">{{starw.attriname}}</el-radio>
                            </el-radio-group>
                        </el-form-item>
                        <el-form-item v-if='form.alreadystudy==1?true:false' label="是否接触过外教课程：" :label-width="formLabelWidth">
                            <el-radio-group disabled  v-model="form.withforeign">
                                <el-radio label=1>是</el-radio>
                                <el-radio label=0>否</el-radio>
                            </el-radio-group>
                        </el-form-item>
                        <el-form-item v-if='form.withforeign==1?true:false' label="学习了多久（单位：月）：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.foreigntime"></el-input>
                        </el-form-item>
                        <el-form-item label="就读学校：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.schoolname"></el-input>
                        </el-form-item>
                        <el-form-item v-if='form.alreadystudy==1?true:false' label="孩子在校的英语成绩排名：" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.englishrank" placeholder="选择排名">
                                <el-option 
                                v-for="(enrank,i) in childData.englishrank"
                                :key="i" :label="enrank.attriname" :value="enrank.attriid"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="孩子目前英语水平：" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.englishlevel" placeholder="请选择">
                                <el-option 
                                v-for="(enlevel,j) in childData.englislevel"
                                :key="j" :label="enlevel.attriname" :value="enlevel.attriid"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="对孩子学习英语的期望：" :label-width="formLabelWidth">
                            <el-checkbox-group disabled v-model="form.expects">
                                <el-checkbox v-for="(expec,k) in childData.expects" :key="k" :label="expec.attriid" name="expects">{{expec.attriname}}</el-checkbox>
                            </el-checkbox-group>
                        </el-form-item>
                        <el-form-item label="更希望孩子提升哪些方面：" :label-width="formLabelWidth">
                            <el-checkbox-group disabled v-model="form.improvefields">
                                <el-checkbox v-for="(impf,l) in childData.improvefields" :key="l" :label="impf.attriid" name="improvefields">{{impf.attriname}}</el-checkbox>
                            </el-checkbox-group>
                        </el-form-item>
                        <el-form-item label="选择机构时首选考虑因素：" :label-width="formLabelWidth">
                            <el-radio-group disabled  v-model="form.considerfield">
                                <el-radio v-for="(consfi,m) in childData.considerfields" :key="m" :label="consfi.attriid">{{consfi.attriname}}</el-radio>
                            </el-radio-group>
                        </el-form-item>
                        <el-form-item label="每周预计投入学习时间：" :label-width="formLabelWidth">
                            <el-radio-group disabled  v-model="form.weekTime">
                                <el-radio v-for="(weekt,n) in childData.weektime" :key="n" :label="weekt.attriid">{{weekt.attriname}}</el-radio>
                            </el-radio-group>
                        </el-form-item>
                        <el-form-item label="适合孩子的上课时间：" :label-width="formLabelWidth">
                            <el-checkbox-group disabled v-model="form.suitabletime">
                                <el-checkbox v-for="(suitt,o) in childData.suitabletime" :key="o" :label="suitt.attriid" name="suitabletime">{{suitt.attriname}}</el-checkbox>
                            </el-checkbox-group>
                        </el-form-item>
                        <el-form-item label="每月孩子学习英语的预算：" :label-width="formLabelWidth">
                            <el-radio-group disabled  v-model="form.monthbudget">
                                <el-radio ref="ref" v-for="(monthb,p) in childData.monthbudget" :key="p" :label="monthb.attriid">{{monthb.attriname}}</el-radio>
                            </el-radio-group>
                        </el-form-item>
                        <el-form-item label="希望完成课程时间：" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.finishtime" placeholder="选择时间">
                                <el-option v-for="(studyshi,q) in childData.studyshijian" :key="q" :label="studyshi.attriname" :value="studyshi.attriid"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="预算：" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.budget" placeholder="选择预算">
                                <el-option v-for="(studymon,r) in childData.studymoney" :key="r" :label="studymon.attriname" :value="studymon.attriid"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="学习诉求：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.appeal"></el-input>
                        </el-form-item>
                        <!-- <el-form-item label="第一次付费金额：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.firstpay" disabled></el-input>
                        </el-form-item> -->
                        <el-form-item label="老师寄语：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.teachernote"></el-input>
                        </el-form-item>
                        <el-form-item label="学员状态：" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.status" placeholder="选择状态">
                                <el-option v-for="(membersta,s) in childData.memberStatusList" 
                                    :key="s" :label="membersta.attriname" 
                                    :value="membersta.attriid"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-form>
                    <!-- 回访记录 -->
                    <el-tag  class='recordStyle' type="info">回访记录</el-tag>
                    <el-table
                        :data="gotRecord"
                        stripe 
                        size="mini"
                        border resizable
                        style="width: 100%;margin-left:40px;"
                        max-height="656">
                        <el-table-column label="回访结果" :align="align" :width="columWidth2">
                            <template slot-scope="scope">{{scope.row.lev1}} {{scope.row.lev2}} {{scope.row.lev3}}</template>
                        </el-table-column>
                        <el-table-column label="回访内容" :align="align" :width="columWidth2">
                            <template slot-scope="scope">{{scope.row.content}}</template>
                        </el-table-column>
                        <el-table-column label="回访人" :align="align" :width="columWidth">
                            <template slot-scope="scope">{{scope.row.agent ? scope.row.agent.realname:''}}</template>
                        </el-table-column>
                        <el-table-column label="回访时间" :align="align" :width="columWidth">
                            <template slot-scope="scope">{{scope.row._time}}</template>
                        </el-table-column>
                    </el-table> 
                    <div slot="footer" class="dialog-footer">
                        <el-button class="dialog_close" @click="dialogFormVisibleda = false">关闭</el-button>
                    </div>
                </el-dialog>
            
                <el-dialog title="查看成人学员信息" 
                    :close-on-click-modal=false 
                    v-if="!ifchild" 
                    :modal=false
                    :visible.sync="dialogFormVisibleda">
                    <el-form :model="form" >
                        <el-form-item label="登录账号：" :label-width="formLabelWidth">
                            <el-input v-model="form.username" disabled></el-input>
                        </el-form-item>
                        <el-form-item label="注册时间：" :label-width="formLabelWidth">
                            <el-input v-model="form.regdate" disabled></el-input>
                        </el-form-item>
                            <el-form-item label="上次登陆时间：" :label-width="formLabelWidth">
                            <el-input v-model="form.lastdate" disabled></el-input>
                        </el-form-item>
                            <el-form-item label="登录次数：" :label-width="formLabelWidth">
                            <el-input v-model="form.loginnum" disabled></el-input>
                        </el-form-item>
                        <el-form-item label="昵称：" :label-width="formLabelWidth">
                            <el-input v-model="form.nickname" disabled class="divided_2"></el-input>
                        </el-form-item>
                        <el-form-item label="真实姓名：" :label-width="formLabelWidth">
                            <el-input v-model="form.fullname" disabled class="divided_2"></el-input>
                        </el-form-item>
                        <el-form-item label="手机：" :label-width="formLabelWidth">
                            <el-input v-model="form.mobile" disabled class="divided_2"></el-input>
                        </el-form-item>
                        <el-form-item label="Email：" :label-width="formLabelWidth">
                            <el-input v-model="form.email" disabled></el-input>
                        </el-form-item>
                        <el-form-item label="性别：" :label-width="formLabelWidth">
                            <el-radio-group  v-model="form.gender" disabled>
                                <el-radio label=1>男</el-radio>
                                <el-radio label=0>女</el-radio>
                            </el-radio-group>
                        </el-form-item>
                        <el-form-item label="大学：" :label-width="formLabelWidth">
                            <el-input v-model="form.daxue" disabled class="divided_2"></el-input>
                        </el-form-item>
                        <el-form-item label="专业：" :label-width="formLabelWidth">
                            <el-input v-model="form.zhuanye" disabled></el-input>
                        </el-form-item>
                        <el-form-item label="公司：" :label-width="formLabelWidth">
                            <el-input v-model="form.gongsi" disabled></el-input>
                        </el-form-item>
                        <el-form-item label="行业：" placeholder="选择一项行业" :label-width="formLabelWidth">
                            <el-select v-model="form.job" disabled>
                                <el-option v-for="(jobitem,c) in fromLabel.job" :key="c" :label="jobitem.attriname" :value="jobitem.attriid"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="职位：" :label-width="formLabelWidth">
                            <el-input v-model="form.zhiwei" disabled></el-input>
                        </el-form-item>
                        
                        <el-form-item label="公司网站：" :label-width="formLabelWidth">
                            <el-input v-model="form.gongsiwangzhi" disabled class="divided_2"></el-input>
                        </el-form-item>
                        <el-form-item label="公司电话：" :label-width="formLabelWidth">
                            <el-input v-model="form.gongsidianhua" disabled class="divided_2"></el-input>
                        </el-form-item>
                        <el-form-item label="公司人事联系人：" :label-width="formLabelWidth">
                            <el-input v-model="form.lianxiren" disabled class="divided_2"></el-input>
                        </el-form-item>
                        <el-form-item label="qq" :label-width="formLabelWidth">
                            <el-input v-model="form.qq" disabled></el-input>
                        </el-form-item>  
                        <el-form-item label="SKype：" :label-width="formLabelWidth">
                            <el-input v-model="form.skypenum" disabled></el-input>
                        </el-form-item>  
                        <el-form-item label="分类：" :label-width="formLabelWidth">
                            <el-radio-group  disabled v-model="form.isfirststudy">
                                <el-radio label=0>第一次学习</el-radio>
                                <el-radio label=1>上过体验课</el-radio>
                            </el-radio-group>
                        </el-form-item>
                        <el-form-item label="年龄段：" placeholder="选取年龄段" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.age">
                                <el-option v-for="(ageitem,a) in fromLabel.age" :key="a" :label="ageitem.attriname" :value="ageitem.attriid"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item :label-width="formLabelWidth" label="学习渠道：">
                            <el-checkbox-group disabled v-model="form.studyfrom">
                                <el-checkbox v-for="(studyfitem,g) in fromLabel.studyfrom" :key="g" :label="studyfitem.attriid" name="studyfrom">{{studyfitem.attriname}}</el-checkbox>
                            </el-checkbox-group>
                        </el-form-item>
                        <el-form-item label="英语水平：" placeholder="选取英语水平" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.studylevel">
                                <el-option v-for="(slitem,b) in fromLabel.studylevel" :key="b" :label="slitem.attriname" :value="slitem.attriid"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="英语分数：" :label-width="formLabelWidth">
                            <el-input v-model="form.highscore" disabled class="divided_2"></el-input>
                        </el-form-item>                     
                        <el-form-item :label-width="formLabelWidth" label="学习英语第一目标-课程：">
                            <el-checkbox-group disabled v-model="form.wanttostudy">
                                <el-checkbox v-for="(ccitem,d) in fromLabel.curriculumType" :key="d" :label="ccitem.id" name="curriculumType">{{ccitem.title}}</el-checkbox>
                            </el-checkbox-group>
                        </el-form-item>
                        <el-form-item :label-width="formLabelWidth" label="学习英语第二目标-方面：">
                            <el-checkbox-group disabled v-model="form.studyhigh">
                                <el-checkbox v-for="(studyhitem,e) in fromLabel.studyhigh" :key="e" :label="studyhitem.attriid" name="studyhigh">{{studyhitem.attriname}}</el-checkbox>
                            </el-checkbox-group>
                        </el-form-item>
                        <el-form-item :label-width="formLabelWidth" label="学习英语第三目标-知识：">
                            <el-checkbox-group disabled v-model="form.studyextension">
                                <el-checkbox v-for="(studyexitem,f) in fromLabel.studyextension" :key="f" :label="studyexitem.attriid" name="studyextension">{{studyexitem.attriname}}</el-checkbox>
                            </el-checkbox-group>
                        </el-form-item>
                        <el-form-item label="希望完成课程时间：" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.studyshijian">
                                <el-option v-for="(stshiitem,h) in fromLabel.studyshijian" :key="h" :label="stshiitem.attriname" :value="stshiitem.attriid"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="预算：" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.studymoney">
                                <el-option v-for="(stmitem,i) in fromLabel.studymoney" :key="i" :label="stmitem.attriname" :value="stmitem.attriid"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="学员评测等级：" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.level">
                                <el-option v-for="(studylevel,j) in fromLabel.StudentEvaluationGrade" :key="j" :label="'level'+studylevel.attriname" :value="studylevel.attriname"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="学员目标等级：" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.targetlevel">
                                <el-option v-for="(studylevel,k) in fromLabel.StudentEvaluationGrade" :key="k" :label="'level'+studylevel.attriname" :value="studylevel.attriname"></el-option>
                            </el-select>
                        </el-form-item>
                        <el-form-item label="学习诉求：" :label-width="formLabelWidth">
                            <el-input v-model="form.iwant" disabled class="divided_2"></el-input>
                        </el-form-item> 
                        <el-form-item label="学员分组：" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.groupid">
                                <el-option v-for="(mgitem,l) in fromLabel.member_group" :key="l" :label="mgitem.name" :value="mgitem.groupid"></el-option>
                            </el-select>
                        </el-form-item>
                        <!-- <el-form-item label="第一次付费金额：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.firstpay" class="divided_2"></el-input>
                        </el-form-item>  -->
                        <el-form-item label="老师寄语：" :label-width="formLabelWidth">
                            <el-input disabled v-model="form.tutorcomment" class="divided_2"></el-input>
                        </el-form-item> 
                        <el-form-item label="学员状态：" :label-width="formLabelWidth">
                            <el-select disabled v-model="form.status" placeholder="选择状态">
                                <el-option v-for="(membersta,s) in fromLabel.memberStatusList" 
                                        :key="s" :label="membersta.attriname" :value="membersta.attriid"></el-option>
                            </el-select>
                        </el-form-item>   
                    </el-form>
                     <!-- 回访记录 -->
                    <el-tag  class='recordStyle' type="info">回访记录</el-tag>
                    <el-table
                        :data="gotRecord"
                        stripe 
                        size="mini"
                        border resizable
                        style="width: 100%;margin-left:40px;"
                        max-height="656">
                    <el-table-column label="回访时间" :align="align" :width="170">
                            <template slot-scope="scope">{{scope.row.time | transData}}</template>
                        </el-table-column>
                        <el-table-column label="回访内容" :align="align" :width="240">
                            <template slot-scope="scope">{{scope.row.content}}</template>
                        </el-table-column>
                        <el-table-column label="回访人" :align="align" :width="170">
                            <template slot-scope="scope">{{scope.row.agent ? scope.row.agent.realname:''}}</template>
                        </el-table-column>
                        <el-table-column label="回访结果" :align="align" :width="240">
                            <template slot-scope="scope">
                                {{scope.row.lev1}}{{scope.row.lev2?'-':''}}{{scope.row.lev2}}{{scope.row.lev3?'-':''}}{{scope.row.lev3}}
                            </template>
                        </el-table-column>
                    </el-table>
                    <div slot="footer" class="dialog-footer">
                        <el-button class="dialog_close" @click="dialogFormVisibleda = false">关闭</el-button>
                    </div>
                </el-dialog>
                
            </div>
            <div slot="footer" class="dialog-footer">
                <el-button class="dialog_close" @click="dialogFormVisible1=false">取 消</el-button>
                <el-button class="dialog_confirm" type="primary" @click="submitEdit">确 定</el-button>
            </div>
        </el-dialog> 

        <!-- 查看课表 -->
        <el-dialog title="查看课表" 
            width='82%'
            :modal=false
            :close-on-click-modal=false
            :visible.sync="dialogFormVisible8">
            <el-button
                icon='el-icon-arrow-left'
                size='mini'
                style="margin-bottom:6px;"
                @click="backTable"></el-button>
            <el-button
                icon='el-icon-arrow-right'
                size='mini'
                style="margin-bottom:6px;"
                @click="nextTable"></el-button>
            <el-table
                :data="experienceData2"
                stripe 
                size="mini"
                border resizable
                style="width: 100%"
                max-height="656">
                <el-table-column label="课程ID" :align="align" :width="columWidth">
                    <template slot-scope="scope">{{scope.row.courseid}} </template>
                </el-table-column>
                <el-table-column label="学校" :align="align" :width="columWidth">
                    <template slot-scope="scope">{{scope.row._school_name}} </template>
                </el-table-column>
                <el-table-column label="班级" :align="align" :width="columWidth">
                    <template slot-scope="scope">{{scope.row.class.name}} </template>
                </el-table-column>
                <el-table-column label="中教" :align="align" :width="columWidth">
                    <template slot-scope="scope">{{scope.row.class.assistant}} </template>
                </el-table-column>
                <el-table-column label="上课时间" :align="align" :width="columWidth">
                    <template slot-scope="scope">{{scope.row.classSchedule.starttime | transData}} </template>
                </el-table-column>
                <el-table-column label="外教" :align="align" :width="columWidth">
                    <template slot-scope="scope">{{scope.row.snap.teachername}} </template>
                </el-table-column> 
                <el-table-column label="教材" :align="align" :width="columWidth">
                    <template slot-scope="scope">{{scope.row.class.name}} </template>
                </el-table-column>
                <el-table-column label="课程性质" :align="align" :width="columWidth">
                    <template slot-scope="scope">{{scope.row.class.classtype==1?'体验班':'正式班'}} </template>
                </el-table-column>                  
            </el-table>
            <div slot="footer" class="dialog-footer">
                <el-button class="dialog_close" @click="dialogFormVisible8=false">取 消</el-button>
                <el-button class="dialog_confirm" type="primary" @click="dialogFormVisible8=false">确 定</el-button>
            </div>
        </el-dialog>

        <!-- 解散班级 -->
        <el-dialog title="解散班级" 
            width='82%'
            :modal=false
            :close-on-click-modal=false
            :visible.sync="dialogFormVisible4">
            <div>确定解散班级？</div>
            <div slot="footer" class="dialog-footer">
                <el-button class="dialog_close" @click="dialogFormVisible4=false">取 消</el-button>
                <el-button class="dialog_confirm" type="primary" @click="confirmRemove">确 定</el-button>
            </div>
        </el-dialog>

        <!-- 预约体验课 -->
        <el-dialog title="预约体验课" 
            width='60%'
            :modal=false
            :close-on-click-modal=false
            :visible.sync="dialogFormVisible2">
            <el-form :model="form">
                <el-form-item label="课程教材：" :label-width="formLabelWidth">
                    <el-select class="divided_200" v-model="course1id" @change="course1Change" placeholder="第一级">
                        <el-option 
                            v-for="(c1,f) in course1"
                            :key="f" :label="c1.title" :value="c1.id"></el-option>
                    </el-select>
                    <el-select class="divided_200" v-if='c2show' v-model="form1.coursewareid" @change="course2Change" placeholder="第二级">
                        <el-option 
                            v-for="(c2,s) in course2"
                            :key="s" :label="c2.title" :value="c2.id"></el-option>
                    </el-select>
                    <el-select class="divided_200" v-if="c3show" v-model="course3id" placeholder="第三级">
                         <el-option 
                            v-for="(c3,t) in course3"
                            :key="t" :label="c3.title" :value="c2.id"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="上课时间：" :label-width="formLabelWidth">
                    <el-date-picker 
                        type="datetime" 
                        placeholder="选择日期" 
                        value-format="yyyy-MM-dd HH:mm:ss"
                        v-model="form1.startdate" 
                        style="width: 180px;"></el-date-picker>
                    <el-date-picker 
                        type="datetime" 
                        placeholder="选择日期" 
                        value-format="yyyy-MM-dd HH:mm:ss"
                        v-model="form1.enddate" 
                        style="width: 180px;"></el-date-picker>
                </el-form-item>
                <el-form-item label="老师区域：" :label-width="formLabelWidth">
                    <el-radio-group v-model="form1.areaid">
                        <el-radio v-for="(aitem,qy) in area" :key='qy' 
                        :label="aitem.attriid">{{aitem.attriname}}</el-radio>
                         <!-- <el-radio label="0">所有区域</el-radio> -->
                    </el-radio-group>
                </el-form-item>
                <!-- <el-form-item label="性别要求：" :label-width="formLabelWidth">
                    <el-radio-group v-model="form1.gender">
                        <el-radio label='0'>无需求</el-radio>
                        <el-radio label='1'>男</el-radio>
                        <el-radio label='2'>女</el-radio>
                    </el-radio-group>
                </el-form-item> -->
                <el-form-item label="上课具体要求：" :label-width="formLabelWidth">
                    <el-radio-group v-model="form1.classtool">
                        <el-radio v-for="(tool,gj) in form1.classTool" :key='gj' 
                        :label="tool.attriid">{{tool.attriname}}</el-radio>
                    </el-radio-group>
                </el-form-item>
                 <!-- <el-form-item label="中文要求：" :label-width="formLabelWidth">
                    <el-radio-group v-model="form1.chineselevel">
                         <el-radio v-for="(clevel,zw) in chineselevel" :key='zw' 
                        :label="clevel.attriid">{{clevel.attriname}}</el-radio>
                    </el-radio-group>
                </el-form-item>  -->
                <el-form-item label-width="260px">
                    <el-button class="search_btn" @click="searchTeacher"><i class="el-icon-search"></i>查询</el-button>
                    <el-button class="reset_btn" @click="clearchaxun"><i class="el-icon-refresh"></i>清空查询</el-button>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button class="dialog_confirm" type="primary" @click="closeAndClear">关闭</el-button>
            </div>
            <!-- 添加成功后展示老师信息 -->
            <teacherCard @changeDia='dialogChange' :availableTeacher='availableTeacher' :form='form1'></teacherCard>
        
             <div class="page_block" v-if='pageDivide'>
                <el-pagination
                    background
                    @current-change="handleCurrentChange2"
                    :current-page.sync="currentPage2"
                    :page-size="page_size2"
                    small
                    layout="prev, pager, next, jumper"
                    :total="totalCount2">
                </el-pagination>
            </div>
        </el-dialog> 
        <v-tour name="myTour" :steps="steps"></v-tour>     
        <div id='tour_position4'></div>
    </div>
</template>

<script>
    import addtoClass from '../components/buttons/addToClass'
    import creatExperience from '../components/buttons/creatExperience.vue'
    import teacherCard from '../components/teacherCard.vue'
    import base from '../api/base.js'
    import {formatDate} from '../../static/js/date.js'
    export default {
        name: 'my-tour',
        components:{
            addtoClass,creatExperience,teacherCard
        },
        data() {
            return {
                tableHeight:window.innerHeight-300,
                loading2:true,
                // 老师列表分页
                pageDivide:false,
                totalCount2:0,
                currentPage2: 1,
                cur_page2:1,
                page_size2:8,

                userid:'',
                ifchild:'',
                userInfo:[],
                fromLabel:[],
                childData:[],
                //回访记录
                gotRecord:[],

                allStudents:[],
                classtype:'experience',
                formInline: {
                    key_word: '',
                    max_num:'',
                    min_num:''
                },
                // 预约体验课表单
                reserveData:{
                    material:"",
                    classTime:'',
                    teacherArea:'',
                    sexNeed:'',
                    toolNeed:'',
                    chineseNeed:''
                },
                classid:'',
                beforeAddwidth:'60%',
                dialogFormVisible1:false,//编辑班级
                dialogFormVisible2:false,//约课
                dialogFormVisible8:false,//查看課表
                dialogFormVisible4:false,//解散班级
                dialogFormVisibleda:false,//档案
                columWidth:180,
                formLabelWidth: '160px',
                columWidth2:140,
                align:'center',
                //按条件筛选老师
                form1: {
                    classid:'',
                    coursewareid:'',
                    startdate:'',
                    classtool:'',
                    enddate:'',
                    areaid:1318,
                    gender:'',
                    chineselevel:'',
                    changeid:'',//改签 课程记录id
                    p:'',
                    page_size:'',
                    classTool:'',
                },
                form: {
                     //  =======================================成人表单数据
                    nickname:'',
                    new_pwd:'',
                    fullname:'',
                    mobile:'',
                    email:'',
                    gender:'',
                    face:'',
                    daxue:'',
                    zhuanye:'',
                    gongsi:'',
                    job:'',
                    zhiwei:'',
                    gongsiwangzhi:'',
                    gongsidianhua:'',
                    lianxiren:'',
                    qq:'',
                    skypenum:'',
                    isfirststudy:'',
                    age:'',
                    studylevel:'',
                    highscore:'',
                    province:'',
                    cityname:'',
                    district:'',
                    wanttostudy:[],
                    studyhigh:[],
                    studyextension:[],
                    // studyfrom:[],
                    studyshijian: '',
                    StudentEvaluationGrade:'',
                    level: '',
                    targetlevel:'',
                    iwant: '',
                    groupid:'',
                    firstpay:'',
                    tutorcomment: '',
                    status:'',
                    //  =======================================少儿
                    username:'',
                    regdate:'',
                    lastdate:'',
                    loginnum:'',
                    new_pwd:'',
                    // nickname: '',
                    mobile:'',
                    fullname: '',
                    sendmail:'',
                    // qq: '',
                    // skypenum:'',
                    email: '',
                    gender:'',
                    birthday: '',
                    toycartoon:'',
                    shoolPeriod: '',//学年
                    xuenianid:'',
                    grade:'',//年级
                    character:'',
                    avatar:'',
                    // province: '',//省
                    // cityname:'',//市
                    // district: '',//区
                    giftAddr:'',
                    studyfrom:[],//学习渠道
                    dadname:'',//父亲
                    dadmobile:'',
                    dadage:'',
                    dadjob:'',
                    mumname:'',//母亲
                    mummobile:'',
                    mumage: '',
                    mumjob:'',
                    familyincome: '',//家庭收入
                    alreadystudy:'',
                    studytime:'',
                    stratway:'',
                    withforeign:'',//是否接触其他外教课程
                    foreigntime:'',
                    schoolname:'',
                    englishrank:'',
                    englishlevel:'',
                    expects:[], 
                    improvefields:[],
                    considerfield:'',//考虑方面
                    weekTime:'',
                    suitabletime:[],
                    monthbudget:'',
                    finishtime:'',
                    budget:'',
                    appeal:'',
                    teachernote:'',
                    state:'',
                    delivery: false, 
                    address:[]
                },
                professional:'',
                chineselevel:'',
                area:'',
                //课件联动
                course1:'',
                course2:'',
                course3:'',
                courseid:0,
                course1id:'',
                course2id:'',
                course3id:'',
                c2show:false,
                c3show:false,
                // 体验班管理表格
                experienceData: [],
                experienceData2: [],
                totalCount:0,
                // 分页数据
                currentPage: 1,
                cur_page:1,
                page_size:16,
                // 单个体验班信息
                classDetail:{
                    name:'',
                    assistant:'',
                    saleid:'',
                    remark:''
                },
                // 添加完的学员信息表格
                studentList:[],
                teacherList:[],
                saleList:[],
                // addedTable:'',//添加成功后展示表格
                availableTeacher:[],//可用的老师
                //课表时间
                date_time:'',
                groupclassid:'',
                now_date:'',
                removeTip:'确定解散班级',
                steps: [
                    {
                        target: '#tour_position3',
                        content: '约体验课之前需先建立体验班。'
                    },
                    {
                        target: '#tour_position4',
                        content: '您可以在“编辑班级”里将学员添加进或移除出班级。也可以约体验课、查看班级课表。当体验课上完之后，体验班就没有用了，此时可以解散班级。不用担心，正式学员会在正式课管理中添加。'
                    },
                ]
            }
        },
        methods: {
            handleCurrentChange2(val) {
                this.loading2=true
                this.cur_page2=val;
                this.avaTeacher2=[]
                this.searchTeacher();
            },
            // 获取回访记录
            getFile(uid,ischild){
                this.dialogFormVisibleda=true;
                this.userid=uid;
                if(ischild==1){
                   this.ifchild=true;
                }else{
                    this.ifchild=false
                }
                this.getUserInfo()
                this.getRecord()
                this.getAdultform()
                this.getChildform()
            },
            // 获取学员信息
            getUserInfo(){
                this.$axios({
                    url: base.baseUrl+"/school/member/get-student-info",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token: localStorage.token,
                        userid:this.userid
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==-1){
                        this.alertTip(res.data.msg)
                    }else if(res.data.code==200){
                        this.userInfo=res.data.data;
                        // 成人
                        this.form.nickname=this.userInfo.nickname;
                        this.form.fullname=this.userInfo.fullname;
                        this.form.mobile=this.userInfo.mobile;
                        this.form.email=this.userInfo.email;
                        this.form.gender=this.userInfo.memberdetail.gender;
                        this.form.province=this.userInfo.memberdetail.giftprovince;
                        this.form.cityname=this.userInfo.memberdetail.giftcity;
                        this.form.district=this.userInfo.memberdetail.giftdistrict;
                        this.form.address.push(this.userInfo.memberdetail.giftprovince,this.userInfo.memberdetail.giftcity,this.userInfo.memberdetail.giftdistrict);
                        this.form.daxue=this.userInfo.memberdetail.daxue;
                        this.form.gongsi=this.userInfo.memberdetail.gongsi;
                        this.form.job=this.userInfo.memberdetail.job;
                        this.form.zhiwei=this.userInfo.memberdetail.zhiwei;
                        this.form.qq=this.userInfo.memberdetail.qq;
                        this.form.skypenum=this.userInfo.memberdetail.skypenum;
                        this.form.isfirststudy=this.userInfo.memberdetail.isfirststudy;
                        this.form.age=this.userInfo.memberdetail.age;
                        this.form.studyfrom=this.userInfo.memberdetail.studyfrom;
                        this.form.studylevel=this.userInfo.memberdetail.studylevel;
                        this.form.wanttostudy=this.userInfo.memberdetail.wanttostudy;
                        this.form.highscore=this.userInfo.memberdetail.highscore;
                        this.form.studyextension=this.userInfo.memberdetail.studyextension;
                        this.form.studyhigh=this.userInfo.memberdetail.studyhigh;
                        this.form.studyshijian=this.userInfo.memberdetail.studyshijian;        
                        this.form.groupid=this.userInfo.groupid;
                        this.form.targetlevel=this.userInfo.memberdetail.targetlevel;
                        this.form.iwant=this.userInfo.memberdetail.iwant;              
                        this.form.level=this.userInfo.memberdetail.level;
                        this.form.firstpay=this.userInfo.memberdetail.firstpay;
                        this.form.tutorcomment=this.userInfo.memberdetail.tutorcomment;
                        this.form.status=this.userInfo.status;
                        this.form.budget=this.userInfo.memberdetail.budget;

                        //少儿
                        this.form.username=this.userInfo.username;
                        this.form.regdate=this.userInfo.regdate;
                        this.form.lastdate=this.userInfo.lastdate;
                        this.form.loginnum=this.userInfo.loginnum;
                        this.form.sendmail=this.userInfo.sendemail;
                        // this.form.birthday=this.userInfo.memberdetail.birthday;
                        this.form.toycartoon=this.userInfo.memberchild.toycartoon;
                        this.form.grade=this.userInfo.memberchild.grade;
                        this.form.birthday=this.userInfo.memberchild.birthyear+'-'+this.userInfo.memberchild.birthmonth+'-'+this.userInfo.memberchild.birthdate;
                        this.form.character=this.userInfo.memberchild.character;
                        // this.form.address=this.userInfo.memberdetail.giftprovince+'-'+this.userInfo.memberdetail.giftcity+'-'+this.userInfo.memberdetail.giftdistrict;
                        this.form.dadname=this.userInfo.memberchild.dadname;
                        this.form.dadage=this.userInfo.memberchild.dadage;
                        this.form.dadjobs=this.userInfo.memberchild.dadjob;
                        this.form.dadmobile=this.userInfo.memberchild.dadmobile;
                        this.form.mumname=this.userInfo.memberchild.mumname;
                        this.form.mummobile=this.userInfo.memberchild.mummobile;
                        this.form.mumage=this.userInfo.memberchild.mumage;
                        this.form.mumjob=this.userInfo.memberchild.mumjob;
                        this.form.familyincome=this.userInfo.memberchild.familyincome;
                        this.form.alreadystudy=this.userInfo.memberdetail.isfirststudy;
                        this.form.stratway=this.userInfo.memberchild.stratway;
                        this.form.withforeign=this.userInfo.memberchild.withforeign;
                        this.form.studytime=this.userInfo.memberchild.learnedtime;
                        this.form.foreigntime=this.userInfo.memberchild.foreigntime;
                        this.form.schoolname=this.userInfo.memberchild.schoolname;
                        this.form.englishrank=this.userInfo.memberchild.englishrank;
                        this.form.englishlevel=this.userInfo.memberchild.englishlevel;
                        this.form.expects=this.userInfo.memberchild.expect;
                        this.form.improvefields=this.userInfo.memberchild.improvefields;
                        this.form.considerfield=this.userInfo.memberchild.considerfield;
                        this.form.weekTime=this.userInfo.memberchild.weektime;
                        this.form.suitabletime=this.userInfo.memberchild.suitabletime;
                        this.form.monthbudget=this.userInfo.memberchild.monthbudget;
                        this.form.teachernote=this.userInfo.memberdetail.tutorcomment;
                        this.form.finishtime=this.userInfo.memberdetail.studyshijian;
                        this.form.budget=this.userInfo.memberdetail.studymoney;
                        this.form.englishlevel=this.userInfo.memberdetail.studylevel;
                        this.form.appeal=this.userInfo.memberdetail.iwant;
                    }else if(res.data.code==-2){
                        this.$router.push('/login')
                    }
                });
            },
            // 获取回访记录
            getRecord(){
                this.$axios({
                    url: base.baseUrl+"/school/member/get-visit",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token: localStorage.token,
                        userid:this.userid
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                   if(res.data.code==200){
                       this.gotRecord=res.data.data
                   }
                });
            },
            // 儿童表单
            getChildform(){
                this.$axios({
                    url: base.baseUrl+"/school/member/get-student-setting ",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token: localStorage.token,
                        user_role:'child'
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    // console.log(res);
                    if(res.data.code==200){
                        this.childData=res.data.data;
                    }
                });
            },
            // ==========================================成人
            getAdultform(){
                this.$axios({
                    url: base.baseUrl+"/school/member/get-student-setting ",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token: localStorage.token
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    // console.log(res);
                    if(res.data.code==200){
                        this.fromLabel=res.data.data;
                    }
                });
            },
            closeAndClear(){
                this.dialogFormVisible2=false
                this.course1id=this.form.coursewareid=''
                this.c2show=false,
                this.form1.startdate=''
                this.form1.classtool=''
                this.form1.enddate=''
                this.form1.gender=''
                this.form1.chineselevel=''
                this.courseid=0
                this.availableTeacher=[]
                this.pageDivide=false
            },
            doRefresh(){
                this.getExclassList()
            },
            dialogChange(){
                this.dialogFormVisible2=false
            },
            onSubmit() {
                // console.log(this.formInline);
                // console.log(this.dialogFormVisible1)
            },
            handleCurrentChange(val) {
                this.cur_page=val;
                this.getExclassList();
            },
            editClass(cid){
                this.classid=cid;
                this.form1.classid=cid;
                this.dialogFormVisible1 = true;
                this.getExclassInfo()
                this.getStudentList()
            },
            // 解散班级
            removeClass(cid){
                this.classid=cid;
                // this.dialogFormVisible4=true
                this.$confirm(this.removeTip, '提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                   this.confirmRemove()
                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消删除'
                    });          
                });
            },
            confirmRemove(){
                this.$axios({
                    url: base.baseUrl+"/school/class/class-ops",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token:localStorage.token,
                        id:this.classid,
                        act:'remove'
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==-1){
                        this.alertTip(res.data.msg)
                    }else if(res.data.code==200){
                        this.alertTip('解散成功')
                    }
                });
            },
            // 获取体验班列表
            getExclassList(){
                this.$axios({
                    url: base.baseUrl+"/school/class/get-class-list",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token:localStorage.token,
                        classtype:1,
                        p:this.cur_page,
                        page_size:this.page_size
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    // console.log(res);
                    if(res.data.code==200){
                        this.experienceData=(res.data.data)[0].class_list;
                        this.loading2=false
                        this.totalCount=Number((res.data.data)[0].pages.total_count);
                    }else if(res.data.code==-2){
                        this.$router.push('/login')
                    }
                }); 
            },
            searchExclass(){
                this.$axios({
                    url: base.baseUrl+"/school/class/get-class-list",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token:localStorage.token,
                        classtype:1,
                        key_word:this.formInline.key_word,
                        max_num:this.formInline.max_num,
                        min_num:this.formInline.min_num,
                        p:this.cur_page,
                        page_size:this.page_size
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==-1){
                        this.alertTip(this.data.msg)
                    }else if(res.data.code==200){
                        this.experienceData=(res.data.data)[0].class_list;
                        this.totalCount=Number((res.data.data)[0].pages.total_count);
                    }else if(res.data.code==-2){
                        this.$router.push('/login')
                    }
                }); 
            },
            clearSearch(){
                this.formInline.key_word=''
                this.formInline.max_num=''
                this.formInline.min_num=''
                this.getExclassList()
            },
            // 清空约课查询
            clearchaxun(){
                this.course1id=this.form.coursewareid=''
                this.c2show=false,
                this.form1.startdate=''
                this.form1.classtool=''
                this.form1.enddate=''
                this.form1.gender=''
                this.form1.chineselevel=''
                this.courseid=0
                this.availableTeacher=[]
                this.pageDivide=false
            },
            //获取班级详情
            getExclassInfo(){
                this.getTeacherList()
                this.getSaleList()
                this.$axios({
                    url: base.baseUrl+"/school/class/get-class-info",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token:localStorage.token,
                        // id:239
                        id:this.classid
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==200){
                        this.classDetail=res.data.data;
                        this.allStudents=res.data.data.student_ids;
                    }else if(res.data.code==-2){
                        this.$router.push('/login')
                    }
                });
            },
            getTeacherList(){
                this.$axios({
                    url: base.baseUrl+"/school/agent/get-role-name",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token:localStorage.token,
                        role:2
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==200){
                        this.teacherList=res.data.data;
                    }else if(res.data.code==-2){
                        this.$router.push('/login')
                    }
                });
            },
            getSaleList(){
                this.$axios({
                    url: base.baseUrl+"/school/agent/get-role-name",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token:localStorage.token,
                        role:18
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==200){
                        this.saleList=res.data.data;
                    }else if(res.data.code==-2){
                        this.$router.push('/login')
                    }
                });
            },
            //添加成功后获取班级学员
            getStudentList(zi){
                if(zi){
                    this.getExclassInfo()
                }else{
                    this.$axios({
                        url: base.baseUrl+"/school/class/get-class-student-list",
                        method: "POST",
                        header: { 'content-type': 'application/x-www-form-urlencoded' },
                        data:{
                            token:localStorage.token,
                            classid:this.classid
                        },
                        transformRequest: [function (data) {
                            let ret = ''
                            for (let it in data) {
                                ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                            }
                            return ret
                        }],
                    }).then(res => {
                        if(res.data.code==200){
                            this.studentList=res.data.data;
                            // this.addedTable=ifshow
                        }else if(res.data.code==-2){
                            this.$router.push('/login')
                        }
                    });
                }
            },
            //移出班级
            outClass(cid,sid){
                this.$axios({
                    url: base.baseUrl+"/school/class/del-students-to-class",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token:localStorage.token,
                        class_id:cid,
                        student_id:sid,
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==-1){
                        this.alertTip(res.data.msg)
                    }else if(res.data.code==200){
                        this.alertTip('移出成功')
                        this. getStudentList()
                    }
                });
            },
            submitEdit(){
                this.dialogFormVisible1=false
                this.$axios({
                    url: base.baseUrl+"/school/class/set-class",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token:localStorage.token,
                        id:this.classid,
                        name:this.classDetail.name,
                        assistant:this.classDetail.assistant,
                        saleid:this.classDetail.saleid,
                        remark:this.classDetail.remark,
                        classtype:1
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==-1){
                        this.alertTip(res.data.msg)
                    }else if(res.data.code==200){
                        this.alertTip('编辑成功')
                    }
                });
            },
            //班级课表
            classTable(cid){
                this.dialogFormVisible8=true
                this.groupclassid=cid
                this.now_date=new Date().getTime()
                this.date_time=this.now_date.toString();
                this.getClassTable() 
            },
            getClassTable(){
                this.$axios({
                    url: base.baseUrl+"/school/class-time-table/get-list",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token:localStorage.token,
                        groupclassid:this.groupclassid,
                        date_time:(this.date_time).substr(0,10)
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==-1){
                        this.alertTip(res.data.msg)
                    }else if(res.data.code==200){
                        this.experienceData2=res.data.data
                    }
                });
            },
            nextTable(){
                this.now_date=this.now_date+7 * 24 * 3600 * 1000
                this.date_time=this.now_date.toString();
                this.getClassTable() 
            },
            backTable(){
                this.now_date=this.now_date-7 * 24 * 3600 * 1000
                this.date_time=this.now_date.toString();
                this.getClassTable() 
            },
            //预约体验课
            reserverClass(cid){
                this.classid=cid
                this.form1.classid=cid;
                this.dialogFormVisible2=true
                this.getTeacherOpt()
                this.getCourseList()
            },
            // 获取老师属性
            getTeacherOpt(){
                 this.$axios({
                    url: base.baseUrl+"/school/course/get-teacher-opt",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token:localStorage.token,
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==200){
                        this.professional=res.data.data.professional;
                        this.area=res.data.data.area;
                        this.chineselevel=res.data.data.chineselevel;
                        this.form1.classTool=res.data.data.classtool

                    }else if(res.data.code==-2){
                        this.$router.push('/login')
                    }
                });
            },
            getCourseList(){
                this.$axios({
                    url: base.baseUrl+"/school/course/get-course-list",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token:localStorage.token,
                        classid:this.classid,
                        coursewareid:this.courseid
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==200){
                        this.course1=res.data.data;
                    }else if(res.data.code==-2){
                        this.$router.push('/login')
                    }
                });
            },
            // 课程联动
            course1Change(e){
                this.courseid=e;
                this.form1.coursewareid=''
                this.getCourse2()
            },
            getCourse2(){
                this.$axios({
                    url: base.baseUrl+"/school/course/get-course-list",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token:localStorage.token,
                        classid:this.classid,
                        coursewareid:this.courseid
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==200){
                        if(res.data.data!=null){
                             this.course2=res.data.data;
                             this.c2show=true
                        }
                    }else if(res.data.code==-2){
                        this.$router.push('/login')
                    }
                });
            },
            course2Change(e){
                this.courseid=e;
                this.getCourse3()
            },
            getCourse3(){
                this.$axios({
                    url: base.baseUrl+"/school/course/get-course-list",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token:localStorage.token,
                        classid:this.classid,
                        coursewareid:this.courseid
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.data.code==200){
                        if(res.data.data!=null){
                             this.course3=res.data.data;
                             this.c3show=true
                        }
                    }else if(res.data.code==-2){
                        this.$router.push('/login')
                    }
                });
            },
            //查询老师
            searchTeacher(){
                this.pageDivide=true
                this.$axios({
                    url: base.baseUrl+"/school/course/experience-teacher-list",
                    method: "POST",
                    header: { 'content-type': 'application/x-www-form-urlencoded' },
                    data:{
                        token:localStorage.token,
                        classid:this.classid,
                        coursewareid:this.form1.coursewareid,
                        startdate:this.form1.startdate,
                        classtool:this.form1.classtool,
                        enddate:this.form1.enddate,
                        // areaid:0,
                        areaid:this.form1.areaid,
                        gender:this.form1.gender,
                        // chineselevel:0
                        chineselevel:this.form1.chineselevel,
                        pagenum:this.cur_page2,
                        pagesize:this.page_size2,
                        // changeid:this.form1.changeid,
                        // p:this.form1.p,
                        // page_size:this.form1.page_size
                    },
                    transformRequest: [function (data) {
                        let ret = ''
                        for (let it in data) {
                            ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                        }
                        return ret
                    }],
                }).then(res => {
                    if(res.status==500){
                        this.alertTip('服务器出错')
                    }else{
                        if(res.data.code==-1){
                            this.alertTip(res.data.msg)
                        }else if(res.data.code==200){
                            this.availableTeacher=res.data.data.teacherlist
                            this.totalCount2=Number(res.data.data.pages.total_count);
                            if(res.data.data==null){
                                this.alertTip(res.data.msg)
                            }
                        }else if(res.data.code==-2){
                            this.$router.push('/login')
                        }
                    }
                });
            },
            alertTip(msg){
                this.$alert(msg, '提示', {
                    confirmButtonText: '确定',
                    // callback: action => {
                    //     this.$message({
                    //         type: 'info',
                    //     });
                    // }
                });
            },
            checkPass(){
                if(document.cookie.indexOf("a=hello")==-1){
                    // alert("首次打开！");
                    var t=new Date(new Date().getTime()+1000*60*60*24*30);
                    document.cookie="a=hello; expires="+t.toGMTString();
                    this.$tours['myTour'].start()
                }else{
                    // alert("再次打开！");
                }
            }
        },
        filters:{
            transData(time){
                return formatDate(new Date(time * 1000), 'yyyy-MM-dd hh:mm');
            }
        },
        created(){
            this.getExclassList()
        },
        mounted: function () {
            this.checkPass()
        }
    }
</script>
<style lang="less" scoped>
    .page_block{
        position: absolute;
        margin-top:12px;
        right: 5%;
    }
    @media screen and (max-width:1700px){
        .el-form--inline{
            width: 1400px;
        }  
    }
    @media screen and (max-width:1380px){
        .search_btn{
            width: 80px!important;
        }  
        .reset_btn{
            width: 100px!important;
        }
        .creatBtn{
            width: 160px!important;
        }
    }
    .recordStyle{
        width: 100%;
        text-align: center;
        margin: 10px 0 30px 40px;
    }
    #tour_position4{
        // width: 10px;
        // height: 10px;
        // background: lightgreen;
        position: absolute;
        top: 220px;
        right:600px;
    }
    
    .experienceClass{
        .experience_inputs{
            height: 60px;
            box-sizing: border-box;
            background: #f5f5f5;
            padding-top: 10px;
            display: flex;
            .creatBtn{
                width: 240px;
                cursor: pointer;
            }
            .operate_inputs{
                // padding: 15px 30px;
                height: 70px;
                box-sizing: border-box;
                button{
                    width: 130px;
                    height: 38px;
                    border-radius: 4px;
                    border: none;
                }
                .search_btn{       
                    background-color: #ff5263;
                }
                .reset_btn{
                    background-color: #808080;
                }
            }
        }
        
    }
    // .page_block{
    //     position: absolute;
    //     margin-top:12px;
    //     right: 0;
    // }
    .search_btn{       
        background-color: #ff5263;
        color: #ffffff;
    }
    .reset_btn{
        background-color: #808080;
        color: #ffffff;
    }
</style>

